#include <stdio.h>
#include <string.h>
#include <string>

typedef struct People {
  char name[20];
  char sex;          //'m': man 'w'： woman
  int age;           //年龄
  char remark[300];  //备注
} PeopleType;

void structCpy(PeopleType *p_people) {
  strcpy(p_people->name, "JCxiaohugong");
  p_people->sex = 'm';
  p_people->age = 23;
  strcpy(p_people->remark,
        "本人，一名机器人领域的嵌入式软件工程师，喜欢跑步、骑行、阅读、打篮球 、打羽毛球、听音乐");
  return;
}

void structPrint(PeopleType *p_people) {
  printf("姓名：%s\n", p_people->name);
  if (p_people->sex == 'm') {
    printf("性别：男\n");
  } else {
    printf("性别：女\n");
  }

  printf("年龄：%d\n", p_people->age);
  printf("备注：%s\n", p_people->remark);
}

bool JudgeNumIsTwoMuli(int num) {
  if (num % 2 == 0) {
    return true;
  } else {
    return false;
  }
}

int main(int argc, char const *argv[]) {
  printf("请输入一个整数：\t");
  int i_num;
  scanf("%d", &i_num);
  int ret;
  ret = JudgeNumIsTwoMuli(i_num);
  if (ret) {
    printf("%d 是2的倍数\n", i_num);
  } else {
    printf("%d 不是2的倍数\n", i_num);
  }

  PeopleType Hmd;
  structCpy(&Hmd);
  structPrint(&Hmd);

  std::string str = "hello world";
  str += "!";
  printf("%s\n", str.c_str());

  return 0;
}
